package com.jun.basic.mapper;

import com.google.common.collect.Lists;
import com.jun.basic.domain.Video;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public class VideoMapper {
    private static Map<Integer, Video> videoMap = new HashMap<>();

    static {
        Video video = new Video();
        video.setId(1);
        video.setTitle("java");
        video.setCreateTime(new Date());
        videoMap.put(1, video);
    }

    public List<Video> listVideo() {
        return Lists.newArrayList(videoMap.values());
    }
}
